<!--
<script>
  <?php
    if(isset($_GET['error'])){
      if($_GET['error'] == 'subscribe'){
  ?>
    alert('Subscribe error, please try again.');
  <?php }} ?>
</script>
-->

<!-- THE MAIN CONTENT CLASS-->
<?php echo $this->renderPartial('/partials/_notifications'); ?>
<div class='mainContainer'>
<div>
  <div>
    <h2 class="differentAlign">Subscribe <span class="differentHeading">Now</span></h2>
      <?php include('_client_notifications.php'); ?>
			<?php
				$form=$this->beginWidget('CActiveForm', array(
				'action' => bu('site/subscribeCreate'),
				));
			?>
			<div class='spacer'>&nbsp;</div>
				<fieldset>
					Email :
					<?php echo $form->textField($subscribe,'email'); ?>
					<?php echo $form->hiddenField($subscribe,'member_type', array('value' => 1)); ?><br /><br />

					Please confirm captcha correctly before submitting<br />
					<?php $form->widget('CCaptcha'); ?><br />
					<?php echo $form->textField($subscribe, 'verifyCode'); ?>
					<?php echo $form->error($subscribe, "verifyCode"); ?><br /><br />
					<input type="submit" value="Subscribe" />
				</fieldset>
			<?php $this->endWidget(); ?>
  </div>

  <div>
    <a style="float:right; margin-right:20px;margin-top:5px;" href="<?php echo bu('news/rss/0'); ?>"><img src="<?php echo bu('images/icons/rss.png'); ?>" style="width:20px;" /></a>
    <h2 class='differentAlign'>Latest <span class='differentHeading'>News & Upcoming Events</span></h2>

    <?php if($news){ ?>
      <?php foreach($news as $n){ ?>
      <div class='news'> <!-- Format the news view -->
        <div>
          <h3><a href='<?php echo bu("news/".$n->id); ?>'><?php echo $n->subject; ?></a></h3>
          <div class='date'><?php echo Helpers::customDate($n->created_at); ?></div>
          <p><?php echo strip_tags(substr($n->content,0,540)); echo " (<a href='".bu("news/".$n->id)."'>Read more</a>)"; ?></p>
        </div>
      </div>
      <?php } ?>
    <?php }else{ echo "<i>No news are currently available.</i>"; } ?>

	  <div class='spacer'>&nbsp;</div>
	  <span class='footnote'><a href='<?php echo bu("news/"); ?>'>Browse all news &raquo;</a></span>
	  <div class='spacer'>&nbsp;</div>

	  <div class='spacer'>&nbsp;</div>
    <a style="float:right; margin-right:20px;margin-top:5px;" href="<?php echo bu('articles/rss/0'); ?>"><img src="<?php echo bu('images/icons/rss.png'); ?>" style="width:20px;" /></a>
	  <h2 class='differentAlign'>Upcoming <span class='differentHeading'>Events</span></h2>
    <?php if($articles){ ?>
      <?php foreach($articles as $article){ ?>
      <div class='news'> <!-- Format the news view -->
        <div>
          <h3><a href='<?php echo bu("articles/".$article->id); ?>'><?php echo $article->subject; ?></a></h3>
          <div class='date'><?php echo Helpers::customDate($article->created_at); ?></div>
          <p><?php echo strip_tags(substr($article->content,0,540)); echo " (<a href='".bu("articles/".$article->id)."'>Read more</a>)"; ?></p>
        </div>
      </div>
      <?php } ?>

      <div class='spacer'>&nbsp;</div>
      <span class='footnote'><a href='<?php echo bu("articles/"); ?>'>Browse all upcomings &raquo;</a></span>
      <div class='spacer'>&nbsp;</div>
    <?php }else{ echo "<i>No articles are currently available.</i>"; } ?>

  </div>
</div>
<!--
<div class='rightPane'>
<a style="float:right; margin-right:10px; margin-top:5px;" href="<?php echo bu('links/rss/0'); ?>"><img src="<?php echo bu('images/icons/rss.png'); ?>" style="width:20px;" /></a>

<h2 class='differentAlign'>Latest <span class='differentHeading'>Links</span></h2>
<div class='spacer'>&nbsp;</div>

<?php if($links){ ?>
  <?php foreach($links as $link){ ?>
  <div>
    <h3><a href='<?php echo $link->url; ?>'><?php echo $link->title; ?></a></h3>
    <p><?php echo substr($link->description,0,540); ?></p>
  </div>
  <?php } ?>
<?php }else{ echo "<i>No links are currently available.</i>"; } ?>
-->

</div>


</div>
